package com.neuedu.his.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neuedu.his.po.Medicalrecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.Select;

public interface MedicalrecordMapper extends BaseMapper<Medicalrecord> {

    @Insert("INSERT INTO MedicalRecord (CaseNumber, RegistID, Readme, Present, CaseState) " +
            "VALUES (#{casenumber}, #{registid}, #{readme}, #{present}, #{casestate})")
    boolean insertMedicalRecord(Medicalrecord medicalRecord);

    @Update("UPDATE MedicalRecord SET " +
            "CaseNumber = #{casenumber}, " +
            "Readme = #{readme}, " +
            "Present = #{present}, " +
            "CaseState = #{casestate} " +
            "WHERE ID = #{id}")
    boolean updateMedicalRecord(Medicalrecord medicalRecord);

    @Select("SELECT * FROM MedicalRecord WHERE RegistID = #{registId}")
    Medicalrecord selectByRegistId(Integer registId);
}